function loadFirstStep(firstId,secondId,cateEname,fatherValue,ctx) {
	//alert("firstId="+firstId+",secondId="+secondId+",cateEname="+cateEname+",fatherValue="+fatherValue+ctx);
	$('#'+firstId).combobox({
		url : ctx+'/dict.do?cateEname='+cateEname+'&fatherValue='+fatherValue,
		valueField : 'id',
		editable : false,
		textField : 'text',
		onChange : function() {
			reloadSecondStep(firstId,secondId,cateEname,ctx);
		}
	});
}

 function reloadSecondStep(firstId,secondId,cateEname,ctx) {
	var tmp = $('#'+firstId).combobox('getValue');
	$('#'+secondId).combobox('clear');
	if (tmp.length > 0) {
		var urlTmp = ctx+'/dict.do?cateEname='+cateEname+'&fatherValue='+ tmp;
		$('#'+secondId).combobox('reload', urlTmp);
		//alert(cityUrlTmp);
	} else {
		$('#'+secondId).combobox('loadData', []);
	}
}

function loadSecondStep(secondId,cateEname,fatherValue,ctx) {
	var url = ctx + '/dict.do?cateEname='+cateEname+'&fatherValue='+fatherValue;
	$('#'+secondId).combobox({
		url : url,
		valueField : 'id',
		textField : 'text',
		editable : false
	});
}

function loadDiceOneStep(firstId,cateEname,fatherValue,ctx,value,callBack) {
		$('#'+firstId).combobox({
			url : ctx+'/dict.do?cateEname='+cateEname+'&fatherValue='+fatherValue,
			value:value,
			valueField : 'id',
			editable : false,
			textField : 'text',
			onSelect:function(rec){
				if(callBack != null && callBack != ""){
					dictOneCallBack(rec,firstId,cateEname);
				}
			}
		});
}


function loadCheckMsg(firstId,cateEname,fatherValue,ctx,secondId,logText) {
	var url = ctx + '/dict.do?cateEname='+cateEname+'&fatherValue='+fatherValue;
	$('#'+firstId).combotree({
		url : url,
		valueField : 'id',
		editable : false,
		textField : 'text',
		onChange : function() {
			reloadCheckMsg(firstId,secondId,cateEname,ctx,logText);
		}
	});
}
function reloadCheckMsg(firstId,secondId,cateEname,ctx,logText){
	var tmp = $('#'+firstId).combobox('getValue');
	$('#'+secondId).combotree({
		url : ctx+'/dict.do?cateEname='+cateEname+'&fatherValue='+tmp,
		valueField : 'id',
		editable : false,
		textField : 'text',
		onChange : function(data) {
			$('#logText').val(data);
		}
	});
}
function loadMeditaName(firstId,cateEname,fatherValue,ctx,value){
	$.ajax( {
          url : ctx+'/dict.do?cateEname='+cateEname+'&fatherValue='+fatherValue,
          dataType: "json",
          success: function(data) {
        	  for(var i=0;i<data.length;i++){
        		  if(i>0 && i<data.length-1){
        			  $("#logText").append('<input type="checkbox" name="meditaName_1" value='+data[i].text+' style="width: 25px;height:16px;"/><span>'+data[i].text+'</span>');
        		  }
        		  if(i==data.length-1){
        			  $("#logText").append('&nbsp;&nbsp;&nbsp;&nbsp;<span>'+data[i].text+'</span>&nbsp;&nbsp;<input type="text" id="meditaName_other" value="" style="width: 150px;height:18px;"/>');
        		  }
        	  }
          }
     });
}
